package com.zxy.servlet;

import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;

import java.io.IOException;
@WebServlet("/serlvet1")
public class Servlet1 extends HttpServlet {
    @Override
    public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
//      接受了用户的请求
        System.out.println("serlet1 执行了");
//        响应重定向  设置响应状态码为302 同时设置location响应头
//        res.sendRedirect("servlet2");
    }
}
